﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ES.Shared.Data
{
    [Serializable]
    public class ColumnInfo
    {
        public ColumnInfo()
        {

        }

        public ColumnInfo(string columnName, SqlDbType sqlDbType, bool nullAllowed)
        {
            ColumnName = columnName;
            SqlDbType = sqlDbType;
            NullAllowed = nullAllowed;
            Size = -1;
            Precision = -1;
            Scale = -1;
        }

        public ColumnInfo(string columnName, SqlDbType sqlDbType, bool nullAllowed, int size)
        {
            ColumnName = columnName;
            SqlDbType = sqlDbType;
            NullAllowed = nullAllowed;
            Size = size;
            Precision = -1;
            Scale = -1;
        }

        public ColumnInfo(string columnName, SqlDbType sqlDbType, bool nullAllowed, int precision, int scale)
        {
            ColumnName = columnName;
            SqlDbType = sqlDbType;
            NullAllowed = nullAllowed;
            Size = -1;
            Precision = precision;
            Scale = scale;
        }

        public string ColumnName
        { get; set; }

        public SqlDbType SqlDbType
        { get; set; }

        public int Size
        { get; set; }

        public int Precision
        { get; set; }

        public int Scale
        { get; set; }

        public bool NullAllowed
        { get; set; }
    }
}
